<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js" type="text/javascript"></script>

</head>

<body>
    <div id="root">
        <h2>欢迎{{name}}来学习</h2>
        <!-- <button v-on:click="showInfo">点我提示信息</button> -->
        <button @click="showInfo">点我提示信息</button>
        <button @click="showInfo1">点我提示信息1</button>
        <button @click="showInfo2($event,66)">点我提示信息2</button>
    </div>
    <script>
        new Vue({
            el: '#root',
            data: {
                name: '123'
            },
            methods: {
                showInfo() {
                    alert('同学你好')
                },
                showInfo1(event) {
                    alert('同学你好!')
                },
                showInfo2(event, number) {
                    // alert('同学你好2')
                    console.log(event, number)
                }
            }


        })

    </script>
</body>

</html>